package com.servers.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.dao.OrderDao;
import com.entity.Order;
import com.servers.OrderServers;
@Service("orderService")
public class OrderServerImpl implements OrderServers{
	@Autowired
	private  OrderDao orderDao;
	
	public int InsertOrderInfo(Order order) {
		return orderDao.AddCommodityToOrder(order);
	}
	@Override
	public List<Order> getOrderInfoBylimit(int page, int size) {
		// TODO Auto-generated method stub
		return orderDao.findAllOrderByLimit(page, size);
	}
	
	@Override
	public List<Order> getOrderByOrderId(int orderId) {
		// TODO Auto-generated method stub
		return orderDao.findOrderByOrderId(orderId);
	}
	@Override
	public List<Order> getOrderByTime(String dateStart, String dateEnd) {
		// TODO Auto-generated method stub
		return orderDao.findOrderByTime(dateStart, dateEnd);
	}
	@Override
	public List<Order> getOrderInfo() {
		// TODO Auto-generated method stub
		return orderDao.findAllOrder();
	}
	@Override
	public int updateOrder(int oid, int status) {
		// TODO Auto-generated method stub
		return orderDao.updateStatus(oid, status);
	}
	public void setOrderDao(OrderDao orderDao) {
		this.orderDao = orderDao;
	}

	
}
